<template>
  <div class="Page Confirm">
    <div class="Title">
      <h1 class="fl f18">订单确认</h1>
      <img src="~/assets/img/cart_setp2.png" class="fr">
      <div class="clear"></div>
    </div>
    <form name="flowForm" id="flowForm" method="post" action="">
      <table class="GoodList">
        <tbody>
        <tr>
          <th class="name">商品</th>
          <th class="price">原价</th>
          <th class="priceNew">价格</th>
        </tr>
        </tbody>
        <tbody>
        <tr>
          <td colspan="3" class="teacher">创始人：{{ order.founderName }}</td>
        </tr>
        <tr class="good">
          <td class="name First">
            <a target="_blank"
               :href="'https://localhost:3000/automobile/'+order.automobileId">
              <img :src="order.fileName"></a>
            <div class="goodInfo">
              <input type="hidden" class="ids ids_14502" value="14502">
              <a target="_blank" :href="'https://localhost:3000/course/'+order.courseId">{{ order.automobileName }}</a>
            </div>
          </td>
          <td class="price">
            <p>￥<strong>{{ order.orderPrice }}</strong></p>
<!--            <span class="discName red">限时8折</span>-->
          </td>
          <td class="red priceNew Last">￥<strong>{{ order.orderPrice }}</strong></td>
        </tr>
        <tr>
          <td class="Billing tr" colspan="3">
            <div class="tr">
              <p>共 <strong class="red">1</strong> 件商品，合计<span
                class="red f20">￥<strong>{{ order.orderPrice }}</strong></span></p>
            </div>
          </td>
        </tr>
        </tbody>
      </table>
      <div class="Finish">
        <div class="fr" id="AgreeDiv">
          <label><p class="on"><input type="checkbox" checked="checked">我已阅读并同意<a href="javascript:" target="_blank">《汽车商城购买协议》</a>
          </p></label>
        </div>
        <div class="clear"></div>
        <div class="Main fl">
          <div class="fl">
            <a :href="'/automobile/'+order.automobileId">返回汽车详情页</a>
          </div>
          <div class="fr">
            <p>共 <strong class="red">1</strong> 件商品，合计<span class="red
            <!--f20">￥<strong id="AllPrice">{{ order.orderPrice }}</strong></span></p>
          </div>
        </div>
        <input name="score" value="0" type="hidden" id="usedScore">
        <button class="fr redb" type="button" id="submitPay" @click="goOrder">去支付</button>
        <div class="clear"></div>
      </div>
    </form>
  </div>
</template>
<script>

import order from "../../api/order/order";

export default {

  data() {
    return {
      order: ''
    }
  },
  created() {
    this.getOrderInfo()
  },
  methods: {

    //获取订单信息
    getOrderInfo() {
      order.getOrder(this.$route.params.oid).then(response => {
        this.order = response.data.data.item
        console.log(this.order)
      })
    },

    tiao(){
      this.$router.push({path: '/'})
    },

    goOrder() {

      //  提示
      this.$message({
        type: 'success',
        message: '支付成功,即将跳转到首页'
      })

      //定时任务方法
      this.$nextTick(() => {
        setInterval(this.tiao, 3400);
      });

      // this.$router.push({path: '/pay/'+this.order.orderId})
    }


  }


}
</script>
